import React, { Component } from 'react';
import { HashRouter as Router, Switch, Route, Redirect} from 'react-router-dom';

//页面
import ProductList   from './index';
import Save          from './index/save';
import ProductDetail from './index/detail';
import CategoryList from './category';
import CategoryAdd from './add';
class ProductRouter extends Component{
	render(){
		return(
			<Switch>
				<Route path="/product/index" component={ProductList} />
				<Route path="/product/save/:pid?" component={Save} />
				<Route path="/product/detail/:pid" component={ProductDetail} />
				<Redirect exact from="/product" to="/product/index" />
				<Route exact path="/product/category/:categoryId?" component={CategoryList} />
				<Route path="/product/add" component={CategoryAdd} />
				
			</Switch>
		);
	}
}

export default ProductRouter;